package com.yuanhua.xcxmng.wechat.security;

import com.yuanhua.xcxmng.wechat.utils.ApiRequestUtils;
import org.springframework.web.filter.OncePerRequestFilter;

import javax.servlet.FilterChain;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @author hzy24985
 * @version $Id: RequestOncePerFilter, v 0.1 2018/8/6 下午5:25 hzy24985 Exp $
 */
public class RequestOncePerFilter extends OncePerRequestFilter {
    @Override
    protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) throws ServletException, IOException {
        ApiRequestUtils.setHttpServletRequest(request);
        ApiRequestUtils.setHttpServletResponse(response);
        filterChain.doFilter(request, response);
    }
}
